package com.usian.controller;

import com.usian.entity.Content;
import com.usian.service.CountentService;
import com.usian.service.FeginCountentService;
import com.usian.vo.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 陈宇轩
 * @version 1.0
 * @date 2023/8/23 20:09
 */

@RestController
@RequestMapping("/coutent")
public class CoutentController {
    @Autowired
    private FeginCountentService feginCountentService;

    @Autowired
    private CountentService countentService;
    @GetMapping("/findCoutent")
    public ResultResponse findCoutent(){
        return feginCountentService.findCountent();
    }

    @GetMapping("/findAllCountent")
    public ResultResponse findAllCountent(){
        try {
            Integer ss=countentService.findAllCountent();
            return ResultResponse.Success(ss);
        }catch (Exception e){
            e.printStackTrace();
            return ResultResponse.Errer();
        }
    }
}
